<template>
  <a-config-provider :locale="zhCN" :theme="themeData">
    <a-style-provider
      :transformers="[legacyLogicalPropertiesTransformer]"
      hash-priority="high"
    >
      <transitionRouter v-if="!showLayoutInfo" transitionName='' />
      <component v-if="showLayoutInfo" :is="comp"></component>
      <contextHolder></contextHolder>
    </a-style-provider>
  </a-config-provider>
</template>
<script setup>
import { legacyLogicalPropertiesTransformer } from "ant-design-vue";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import { computed, ref, watchEffect } from "vue";
import {
  childrenList,
  qiankunParentMap,
  qiankunParentMapKeyName,
} from "@/constant/dictionary";
import { useRoute } from "vue-router";
import { contextHolder } from "@/hooks/message";
const route = useRoute();
const showLayoutInfo = computed(() => {
  return childrenList.find((item) => route.path.startsWith(item.activeRule));
});
const comp = ref(null);

const themeData = {
  token: {
    borderRadius: 0,
  },
};
watchEffect(() => {
  comp.value = showLayoutInfo.value
    ? qiankunParentMap[showLayoutInfo.value.parentCompType]
    : qiankunParentMap[qiankunParentMapKeyName.LAYOUT];
});
</script>